<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="/views/commons/taglibs.jsp" %>
<c:choose>
<c:when test="${paramMap.type==1}">
	<div class="panel-heading">
		<h3 class="panel-title">已分配用户列表</h3>
	</div>
	<div class="bd clearfix">
		<form id="role_user_has_form" action="javascript:void(0);">
			<input type="hidden" name="type" id="list_type" value="${paramMap.type}">
			<div class="filter-wrap">
				<dl class="clearfix invest-filter">
					<dt>用户姓名</dt>
					<dd class="clearfix">
						<div class="col-sm-8 mb20">
							<div class="input-group">
								<input type="text" name="roleName" value="${paramMap.roleName}" class="form-control" placeholder="请输入用户姓名关键字">
								<span class="input-group-btn">
									<button class="btn btn-primary" type="button" onclick="javascript:queryRoleUserList_has(1);">搜索</button>
								</span>
							</div>
						</div>
					</dd>
				</dl>
			</div>
		</form>
	</div>
</c:when>
<c:otherwise>
	<div class="panel-heading">
		<h3 class="panel-title">未分配用户列表</h3>
	</div>
	<div class="bd clearfix">
		<form id="role_user_not_own_form" action="javascript:void(0);">
			<input type="hidden" name="type" id="list_type" value="${paramMap.type}">
			<div class="filter-wrap">
				<dl class="clearfix invest-filter">
					<dt>用户姓名</dt>
					<dd class="clearfix">
						<div class="col-sm-8 mb20">
							<div class="input-group">
								<input type="text" name="userName" value="${paramMap.userName}" class="form-control" placeholder="请输入用户姓名关键字">
								<span class="input-group-btn">
									<button class="btn btn-primary" type="button" onclick="javascript:queryRoleUserList_not_own(1);">搜索</button>
								</span>
							</div>
						</div>
					</dd>
				</dl>
			</div>
		</form>
	</div>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${!empty dataList && fn:length(dataList) ne 0}">
<table class="table">
	<thead>
		<tr>
			<th width="30%">用户姓名</th>
			<th width="30%">用户账号</th>
			<th width="40%">操作</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="adminUserVO" items="${dataList}" varStatus="index">
		<tr>
			<td class="title">${adminUserVO.userName}</td>
			<td >${adminUserVO.userAccount}</td>
			<td>
				<c:choose>
				<c:when test="${paramMap.type==1}">
					<a href="javascript:deleteRoleUser('${adminUserVO.adminUserId}')">收回该用户的角色</a>
				</c:when>
				<c:otherwise>
					<a href="javascript:addRoleUser('${adminUserVO.adminUserId}')">分配角色给该用户</a>
				</c:otherwise>
				</c:choose>
			</td>
		</tr>
		</c:forEach>
	</tbody>
</table>
<!-- 分页 -->
<c:choose>
<c:when test="${paramMap.type==1}">
	<p:pagination pageNo="${paramMap.pageNo}" pageCount="${paramMap.pageCount}" queryFunction="queryRoleUserList_has" style="text-center"></p:pagination>
</c:when>
<c:otherwise>
	<p:pagination pageNo="${paramMap.pageNo}" pageCount="${paramMap.pageCount}" queryFunction="queryRoleUserList_not_own" style="text-center"></p:pagination>
</c:otherwise>
</c:choose>

<!-- 分页 end -->
</c:when>
<c:otherwise>
	<table class="table">
		<thead>
			<tr>
				<th width="30%">用户姓名</th>
				<th width="30%">用户账号</th>
				<th width="40%">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td colspan="3" align="center">
					暂无数据
				</td>
			</tr>
		</tbody>
	</table>
</c:otherwise>
</c:choose>